local lsp_linghuo = fk.CreateSkill {
    name = "lsp_linghuo",
    anim_type = "offensive",
    tags = { Skill.Compulsory }
}

Fk:loadTranslationTable {
    ["lsp_linghuo"] = "灵火",
    [":lsp_linghuo"] = "锁定技，当你造成火焰伤害时，你摸一张牌且此伤害+1；你对其他角色造成的非火焰伤害均视为无来源；准备阶段，若存活角色数不小于4，你增加一点体力上限。",
}
lsp_linghuo:addEffect(fk.PreDamage, {
    can_trigger = function(self, event, target, player, data)
        return player:hasSkill(lsp_linghuo.name) and target == player and data.to ~= player and
            data.damageType ~= fk.FireDamage
    end,
    on_use = function(self, event, target, player, data)
        data.from = nil
    end,
})
lsp_linghuo:addEffect(fk.DetermineDamageCaused, {
    can_trigger = function(self, event, target, player, data)
        return player:hasSkill(lsp_linghuo.name) and target == player and data.damageType == fk.FireDamage
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        player:drawCards(1, lsp_linghuo.name)
        data:changeDamage(1)
    end,
})
lsp_linghuo:addEffect(fk.EventPhaseStart, {
  anim_type = "defensive",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(lsp_linghuo.name) and target == player and player.phase == Player.Start and #player.room.alive_players >= 4
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:changeMaxHp(player, 1)
  end,
})
return lsp_linghuo
